import Vue from 'vue'
// import router from './router'
import axios from 'axios'

const http = axios.create({
    baseURL: 'http://127.0.0.1:3000'
})


//错误拦截
http.interceptors.response.use(res => {
    return res
}, err => {
    console.log(err)
    if (err.response.data.message) {
        Vue.prototype.$message({
            type: 'error',
            message: err.response.data.message
        })
    }
    return Promise.reject(err)
})

export default http